<?php


namespace app\Server;


use yzh52521\EasyHttp\Http;

class TcpServer
{
    protected $api = "http://127.0.0.1:8080";

    public function readyGame(string $key,string $cardNo,string $deviceKey,int $time)
    {
        dump("参数",[
            "key"=>$key,
            "card_no"=>$cardNo,
            "device_key"=>$deviceKey,
            "time"=>$time
        ]);
        return Http::asJson()->post($this->api."/game/ready",[
            "key"=>$key,
            "card_no"=>$cardNo,
            "device_key"=>$deviceKey,
            "time"=>$time
        ]);
    }

    public function controlTcp($key,$device)
    {
        return Http::asJson()->post($this->api."/tcp/control",[
            "key"=>$key,
            "device"=>$device,
        ]);
    }

}